package com.study;

import com.google.common.collect.Lists;
import com.study.util.FileUtil;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Test10
 *
 * @author wanghuilong
 * @version 1.0
 * @description
 * @date 2023/1/3 17:20
 */
public class Test10 {





    public static void main(String[] args) {
//        String sql = "(s.generic_name = '$0' and ss.spec = '$1' and ss.unit = '$2')";
//
//        List<String> contents = FileUtil.readTxtFileIntoStringArrList("/Users/wanghuilong/IdeaProjects/lazy/src/main/resources/file/8.txt",null);
//
//        List<String> list = new ArrayList<>();
//        for (int i = 0; i < contents.size(); i++) {
//            String str = contents.get(i);
//            String[] split = str.split("\t");
//            String strLine = sql;
//            for (int j = 0; j < split.length; j++) {
//                strLine = strLine.replace("$"+j,split[j]);
//            }
//            list.add(strLine);
//        }
//        String line = StringUtils.join(list," or ");
//        System.out.println(line);

        String table= "spu_drug_info";

        Map<String,String> map = new HashMap<>();
        map.put("spu_drug_info","test");


        String eventTableWithoutIndex = table;
        if(table.contains("_")){
            eventTableWithoutIndex = StringUtils.substring(table, 0, table.lastIndexOf("_"));
        }

        System.out.println(eventTableWithoutIndex);

        System.out.println(map.containsKey(eventTableWithoutIndex));


        List<String> skuId = Lists.newArrayList("579594538352649","579628025667593","579629057474569");

        System.out.println("1fbb0c63c0bd457".hashCode()%8);

        System.out.println("599912803999753".hashCode()%8);

        System.out.println("594767055683593".hashCode()%108);

        System.out.println("599912803999753".hashCode()%108);


        System.out.println("610586678566922".hashCode()%108);


        long n = 15314570788864L >> 23;

        System.out.println(Math.abs(n) % 128);

    }

}
